package com.nuoniu.sibanyun.mapper.crm;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nuoniu.sibanyun.entity.crm.ApprovalProcess;
import com.nuoniu.sibanyun.mapper.provider.CrmMapperProvider;
import com.nuoniu.sibanyun.userThread.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * <p>
 * 审批流程 Mapper 接口
 * </p>
 *
 * @author baiqiang
 * @since 2020-06-20
 */
@Component
@Mapper
public interface ApprovalProcessMapper extends BaseMapper<ApprovalProcess> {

    /**
     * 获取审批流程
     * @author 小啊刚
     * @date 2020/6/20
     */
    @Select("select * from approval_process where process_type = #{type} and company_id = #{companyId} and status = 0 order by process_sort")
    List<ApprovalProcess> getProcessByType(Integer type, Integer companyId);

    @Update("update approval_process set approval_user_name = #{realName} where approval_user_id = #{id}")
    void updateUserName(String id, String realName);
}
